package com.cartgo.controller
{
	import com.cartgo.manager.ErrorManager;
	import com.cartgo.vo.errors.VOSqlError;
	import com.cartgo.vo.errors.VOServiceError;
	
	import mx.controls.Alert;
	import mx.rpc.events.ResultEvent;

	public class BaseController
	{
		public function BaseController()
		{
			//constructor
		}
		
		protected function checkRemoteError(evt:ResultEvent):Boolean{
			var errorExist:Boolean;
			
			if(evt.result is VOSqlError){
				errorExist = true;
				ErrorManager.showSqlError(evt.result as VOSqlError);
			} else if (evt.result is VOServiceError) {
				errorExist = true;
				ErrorManager.showServiceError(evt.result as VOServiceError);
			} else {
				errorExist = false;
			}
			return errorExist;
		}
	}
}